#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>

#define TRIANGLE_LENGTH 65

uint64_t triangle[TRIANGLE_LENGTH][TRIANGLE_LENGTH];

void prepare() {
    for(int y = 0; y < TRIANGLE_LENGTH; y++) {
        for(int x = 0; x <= y; x++) {
            if (y == 0 || y == TRIANGLE_LENGTH - 1) {
                triangle[y][x] = 1;
            } else {
                triangle[y][x] = triangle[y - 1][x - 1] + triangle[y - 1][x];
            }
        }
    }
}

uint64_t C(int n, int m) {
    return triangle[n][m];
}

void once(int bits) {
    printf("2^%d=", bits);
    for (int i = 0; i <= bits; i++) {
        printf("%" PRId64, triangle[bits][i]);
        if (i != bits) {
            putchar('+');
        } else {
            putchar('\n');
        }
    }
}

int main(void) {
    prepare();
    while (1) {
        int64_t num;
        scanf("%" SCNd64, &num);
        if (num < 0) { 
            break;
        }
        once(num);
    }
    return 0;
}
